import { Mongo } from 'meteor/mongo';
import { SimpleSchema } from 'meteor/aldeed:simple-schema';

import { Meteor } from 'meteor/meteor';

class DeviceAlarmsCollection extends Mongo.Collection {
    update(selector, modifier) {
        const result = super.update(selector, modifier);
        return result;
    }
    insert(log, callback) {
        const ourDeviceAlarms = log;
        const result = super.insert(ourDeviceAlarms, callback);
        return result;
    }
    remove(selector, callback) {
        const result = super.remove(selector, callback);
        return result;
    }
}

export const DeviceAlarms = new DeviceAlarmsCollection('devicealarms');

DeviceAlarms.deny({
    insert() { return true; },
    update() { return true; },
    remove() { return true; },
});

DeviceAlarms.schema = new SimpleSchema({

    alarmType:{
        label:"报警类型",
        type:String
    },
    alarmTime:{
        label:"报警时间",
        type:Date
    },
    telephone: {
        label: '手机号',
        type: String
    },
    deviceId: {
        label: '设备ＩＤ',
        type: String
    },
    familyId: {
        label: '家庭ＩＤ',
        type: String
    },

});
DeviceAlarms.attachSchema(DeviceAlarms.schema);
